#ifndef __WIZ_BNF_ID_HPP__SHANHAOBO_19800429__
#define __WIZ_BNF_ID_HPP__SHANHAOBO_19800429__

#include "../Base/Type/WizBaseType.hpp"
#include "../Base/Cast/WizBaseCast.hpp"

namespace Wiz
{
    namespace BNF
    {
        namespace ID
        {
            class Type
            {
            public:
                Type()                                          : m_RulePtr(WIZ_NULLPTR) {}
                explicit Type(::Wiz::Void::Type const* RulePtr) : m_RulePtr(RulePtr) {}
                Type(::Wiz::PtrDiff::Type UI)                   : m_PtrDiff(UI) {}

                ::Wiz::Bool::Type operator==(Type const& Other) const
                {
                    return m_RulePtr == Other.m_RulePtr;
                }
                ::Wiz::Bool::Type operator!=(Type const& Other) const
                {
                    return !(*this == Other);
                }
                ::Wiz::Bool::Type operator<(Type const& Other) const
                {
                    return m_RulePtr < Other.m_RulePtr;
                }
                ::Wiz::PtrDiff::Type ToUint() const
                {
                    return m_PtrDiff;
                }
            private:
                union
                {
                    ::Wiz::Void::Type const*    m_RulePtr;
                    ::Wiz::PtrDiff::Type        m_PtrDiff;
                };
            };
            WIZ_DECLARE(::Wiz::BNF::ID::Type);
        } /// end of namespace ID

        namespace Tag
        {
            namespace Address
            {
                struct Type
                {
                    ::Wiz::BNF::ID::Type ID() const
                    {
                        return ::Wiz::BNF::ID::Type(::Wiz::Cast::Reinterpret<::Wiz::PtrDiff::Type>(this));
                    }
                };
            } /// end of namespace Address
        } /// end of namespace Tag
    } /// end of namespace BNF
} /// end of namespace Wiz

#endif /*__WIZ_BNF_ID_HPP__SHANHAOBO_19800429__*/
